home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Word / E-G / Fedit Tricks < prev    next >
Encoding:
Text File  |  1987-05-25  |  8.1 KB  |  158 lines  |  [TEXT/MSWD]

  1.  
  2. FEdit tricks              -Tom Zusag
  3. ============
  4. Making a 405k SS disk
  5. ---------------------
  6. You can make a single-sided disk which will hold 405k of storage, but you 
  7. give up 5k of directory blocks to do it.  This leaves only room for about 
  8. 16 file entries (more if your file names are short) in the directory.  
  9. It might be useful on occasion, so here's how to do it.  All you need is 
  10. FEdit or some other disk block editor and a new, freshly initialized disk 
  11. (let it keep the name "untitled.")  Run FEdit, then open the volume 
  12. "untitled."  Select "Hex display", and scroll to sector 2.  This is the 
  13. start of the volume information table for the disk.  The bytes you are 
  14. interested in start at location 0010 (outlined by braces"{}" below:)
  15.   
  16. Sect: 0002
  17. Tags: 0000 0000 0000 0000 9C1B 65F4
  18. 0000: D2D7 9C1B 65F4 9C1B 65F4 0000 0000 0004    ....e...e.......
  19. 0010:{000C 0187}0000 0400 0000 2000{0010}0000    .......... .....
  20. 0020:{0002 0186}0855 6E74 6974 6C65 6400 0000    .....Untitled...
  21.   
  22. The meaning of this information is as follows (thanks to John Mitchell):
  23.   
  24. Starting      Data
  25. Location   Explanation
  26.   0000     $D2D7 "RW" with the high bit set (Randy Wiggington, 
  27.            the architect of the Mac disk format)
  28.   0002     Date and time of initialization in seconds after 1/1/1904
  29.   0006     Date and time of last disk write (updated automatically)
  30.   000A     Volume attributes
  31.   000C     Number of file entries in directory (Gotta change this)
  32.   000E     Starting sector for directory
  33.   0010     Number of sectors the directory occupies (Change this also)
  34.   0012     Total number of allocation blocks in volume (Ditto)
  35.   0014     Size of each allocation block in bytes (eg, 1024 = $0400)
  36.   0018     Minimum initial file allocation "Clip" size, 8096 bytes
  37.   001C     Number of first sector for files (Another change)
  38.   001E     The next file number to use (increments on each disk write?)
  39.   0022     Number of unused allocation blocks (Change this too)
  40.   0024     Length of the volume name
  41.   0025     Volume name in Ascii
  42.   
  43. Now enable "Hex Modify", and make the following changes starting at these locations:
  44.   
  45. Location 0010:   000C  to  0002  (Change the number of directory sectors)
  46. Location 0012:   0187  to  018C  (and the number of data blocks)
  47. Location 001C:   0010  to  0006  (New start of data sectors)
  48. Location 0020:   0002  to  0003  (Gotta do this to make it work)
  49. Location 0022:   0186  to  018B  (New number of unused blocks)
  50.   
  51. Here's what you want before you write the sector to disk:
  52.   
  53. Sect: 0002
  54. Tags: 0000 0000 0000 0000 9C1B 65F4
  55. 0000: D2D7 9C1B 65F4 9C1B 65F4 0000 0000 0004    ....e...e.......
  56. 0010:{0002 018C}0000 0400 0000 2000{0006}0000    .......... .....
  57. 0020:{0003 018B}0855 6E74 6974 6C65 6400 0000    .....Untitled...
  58.   
  59. Now write the sector to disk, and then FEdit will tell you that you have changed the Volume table, and it will eject the disk to prevent problems.
  60. Now quit FEdit.  Back in the Finder, insert the disk.  A box comes up 
  61. telling you the disk needs "minor repairs."  Make them.  When it is 
  62. finished, you have a disk with 405k of storage.  If you look at the disk 
  63. again with FEdit you will find that it has made changes something like that 
  64. shown below:
  65.   
  66. Sect: 0002
  67. Tags: 0000 0000 0000 0000 9C1B 668D
  68. 0000: D2D7 9C1B 668D 9C1B 668D 0040 0001 0004    ....e...f..@....
  69. 0010:{0002 018C}0000 0400 0000 2000{0006}0000    .......... .....
  70. 0020:{0004 018B}0855 6E74 6974 6C65 6400 0000    .....Untitled...
  71.   
  72.   
  73. A word on file names
  74. Now remember that you have just decreased the number of directory sectors 
  75. available from $C (12 decimal) to 2.  Each directory entry consists of a 50 
  76. byte header and a variable length name.  Entries may not cross sector 
  77. boundaries. Keep your file names short! If each file name were only 1 
  78. character, 10 entries would just fit in each 512 byte sector.  If you are 
  79. satisfied with 9 entries per sector, you file names must average only 6.8 
  80. characters each.  And so on.  You can see if you are a verbose person, and 
  81. use 36 to 52 characters for each filename, you only get 5 entries per 
  82. sector.  That's only 60 files on a normal disk, and only 10 files on a 405k 
  83. disk.
  84.   
  85.   
  86. Locking in the Finder
  87. =====================
  88. You can modify Finder 4.1 to "lock in" the System and Finder on a disk, even 
  89. if an application is run from another system-containing disk.  As you are 
  90. aware, the system file generally contains the fonts, desk accessories, and 
  91. special features available at any given time.  When you run an application 
  92. which is on another disk, which has its own copy of the System and Finder, 
  93. that system becomes the system in control of the Mac, and its desk 
  94. accessories, fonts, etc., now supercede those available previously.  This 
  95. feature has its advantages and disadvantages, depending upon which set of 
  96. DA's, fonts, and system files you want active.  Previously, to prevent this 
  97. kind of sleight-of-hand switching of systems, it was necessary to remove the 
  98. system or Finder from the other application's disk.  NO LONGER!  By making a 
  99. small patch to the Finder with FEdit, the Finder can be locked in place.  
  100. Here's how.  With FEdit, do a HEX Search for the string "6726554F4878"  It 
  101. should be somewhere around block 24 of the file.  Change the first 7 to 0 
  102. (zero) so that this string becomes "6026554F4878".  Then write the change to 
  103. disk.  Even though the change is confined to one character, search for the 
  104. whole string to be sure you get the correct location for the patch.
  105. NOTE: This Finder is so tenacious in its grasp, that it will not relinquish 
  106. control even if you /Option/doubleclick a Finder on another disk.
  107.   
  108.   
  109. Adding Command keys to application menus
  110. ========================================
  111. You can use Fedit add or change the command key equivalents for menu items 
  112. in any application.  Here's an example using MacWrite 2.2:
  113.  
  114. Run FEdit, and OPEN FILE the application to edit.  Do an ASCII search for 
  115. the first menu item you remember.  For me, that was "About MacWrite."  If 
  116. you're not sure about the capitalization, check the IGNORE CASE box.  After 
  117. a nanosecond or two, you'll see a screen that shows the start of all of the 
  118. menu items for MacWrite.  Each menu item has the format:  "ITEM", zero, 
  119. command key, 3 trailing bytes.  For our purposes, each item in a given menu 
  120. can be thought of as having one of two forms when viewed by FEdit's ASCII 
  121. display option   (Command keys are already added to the two examples below 
  122. for clarity:)
  123.   
  124.    Open....O...       or      Close.K...
  125.   
  126. The dots in the above items may or may not represent actual periods or 
  127. unprintable characters.  You can find out by clicking on the dot and looking 
  128. in the lower left of the screen to see its Hex equivalent.  A real period is 
  129. Hex 2E.  You'll recall that the open menu item in MacWrite is really 
  130. "Open...".   It's actually not important, because after each menu item are 
  131. five trailing bytes with which we are concerned.  The first byte is 00.  The 
  132. second is where the command key equivalent goes.  The next two are both 00, 
  133. and the last is some kind of trailing data byte.  The items for the Edit 
  134. menu would appear thusly:
  135.   
  136. Edit.Undo.Z...-.....Cut.X...Copy.C...Paste.V...-.....Show Clipboard.....
  137.   
  138. It's not too hard to figure out what you have to do to change these.  If you 
  139. wanted "P" for Paste and "V" for View Clipboard, all you have to do is get 
  140. the line to read:
  141.   
  142. Edit.Undo.Z...-.....Cut.X...Copy.C...Paste.P...-.....View Clipboard.V...
  143.   
  144. Remember that it's not smart to use characters which are used by other menu 
  145. items.  It doesn't really hurt anything.  But the menu item farthest to the 
  146. right/bottom is the one that will recognize the duplicate key equivalent 
  147. first.  Of course, if that one is dimmed for some reason, then the next one 
  148. down the line gets to work.  Hmmmm..... interesting.
  149.   
  150. A further note.  The key equivalents are limited to the character set you 
  151. would get when using the Caps lock key down.  That is, all the alphabetic 
  152. characters (A-Z) are capitalized, and all the others are unshifted.  
  153. Therefore you can't use the "?" as a command key equivalent, but must 
  154. instead use the "/".  You can enter it into the menu but it just won't get 
  155. recognized.  This has to be so, because the Command/shift/keys are all 
  156. special function keys used by the system.  
  157.   
  158.